package com.yuanlrc.base.entity.admin;

import com.yuanlrc.base.annotion.ValidateEntity;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

/**
 * 图书馆信息实体类
 *
 */

@Entity
@Table(name="ylrc_library")
@EntityListeners(AuditingEntityListener.class)
public class Library extends BaseEntity{

    @ValidateEntity(required=true,requiredLeng=true,minLength=2,maxLength=10,errorRequiredMsg="书屋名称不能为空!",errorMinLengthMsg="书屋名称长度需大于2!",errorMaxLengthMsg="书屋名称长度不能大于10!")
    @Column(name="library_name",nullable=false,length=255)
    private String libraryName;//书屋名称

    @ManyToOne
    @JoinColumn(name="faculties_id")
    private Faculties faculties;//所属学院名称

    @Column(name="library_status",nullable=false,length=255)
    private Integer libraryStatus;//书屋状态

    @ValidateEntity(required=true,requiredLeng=true,minLength=1,maxLength=4,errorRequiredMsg="所在楼层不能为空!",errorMinLengthMsg="楼层名称长度需大于1!",errorMaxLengthMsg="楼层名称长度不能大于4!")
    @Column(name="library_floor",nullable=false,length=255)
    private String libraryFloor ;//所在楼层

    @ValidateEntity(required=true,requiredLeng=true,minLength=1,maxLength=4,errorRequiredMsg="管理员名字不能为空!",errorMinLengthMsg="管理员名称长度需大于1!",errorMaxLengthMsg="楼层名称长度不能大于4!")
    @Column(name="library_admin",nullable=false,length=255)
    private String libraryAdmin ;//书屋管理员

    @ValidateEntity(required=true,requiredLeng=true,minLength=11,maxLength=11,errorRequiredMsg="联系人电话不能为空!",errorMinLengthMsg="联系人电话长度必须为11!",errorMaxLengthMsg="联系人电话长度必须为11!")
    @Column(name="admin_phone",nullable=false,length=255)
    private String adminPhone ;//管理员联系电话

    public String getLibraryName() {
        return libraryName;
    }

    public void setLibraryName(String libraryName) {
        this.libraryName = libraryName;
    }

    public Integer getLibraryStatus() {
        return libraryStatus;
    }

    public void setLibraryStatus(Integer libraryStatus) {
        this.libraryStatus = libraryStatus;
    }

    public String getLibraryFloor() {
        return libraryFloor;
    }

    public void setLibraryFloor(String libraryFloor) {
        this.libraryFloor = libraryFloor;
    }

    public String getLibraryAdmin() {
        return libraryAdmin;
    }

    public void setLibraryAdmin(String libraryAdmin) {
        this.libraryAdmin = libraryAdmin;
    }

    public String getAdminPhone() {
        return adminPhone;
    }

    public void setAdminPhone(String adminPhone) {
        this.adminPhone = adminPhone;
    }

    public Faculties getFaculties() {
        return faculties;
    }

    public void setFaculties(Faculties faculties) {
        this.faculties = faculties;
    }
}

